Select the Reverse Engineering Options

After you select the model type, template, and database, set the options to reverse engineer specific objects. The options that you select here determine the objects that are included in the model. However, when you reverse engineer from a script, these options are overridden and all the objects are reverse engineered.

The modeling tool builds its models by querying the system catalog of the database, rather than querying the specific objects. You must have read and write permissions on all the objects that you want to reverse engineer.

Follow these steps:

  1. On the Actions, click Reverse Engineer.

    The New Model dialog box opens.

  2. Select the new model type, template, and target database. Then, click Next.

    The Reverse Engineering Wizard opens.

  3. On the Overview tab, and work on the following options:
    Reverse Engineer From

    Specifies whether you want to reverse engineer from a database, keyspace, bucket, or a script. If you click script, click Browse to select the file.

    Note: To reverse engineer from a script, select a file that is saved either in ANSI or ASCII format.

  4. On the Connection tab, based on your database, configure appropriate database connection parameters.
    For more information, refer to the Database Connection Parameters topic.
  5. Based on your target database, on the Schemas, Keypaces, Database, or Buckets tab, select the databases to reverse engineer. To reverse engineer system tables, views, and stored procedures related to system tables, select the System Objects check box.
  6. Use the following target database-specific options:

    MongoDB:

    • Document Count/Document (%): Use this option to specify the number of documents or percentage of total records that the newly generated model schema would contain.

    • Deep Search: Use this option to specify whether the deep search algorithm is used to retrieve the right samples for schema generation.

    • Sampling: Use the Sequence or Random sampling methods to sample records in the selected collections. Sampling enables you to retrieve right estimates for accurate collection schema generation.

    Couchbase:

    • Sample Size:

  7. Based on your target database, on the Tables, Collections, or Documents tab, select the tables to reverse engineer.
  8. On the Option Set tab, select a default or custom option set.
  9. On the Detailed Options tab, work on the following options:
    NSM Options

    Select the naming standard glossary file (.CSV) that you want to apply to your model.

    Reverse Engineer

    Specifies whether you want to reverse engineer system objects and user tables, or only user tables. If you select the System Objects check box the system tables, views, and stored procedures related to system tables are reverse engineered.

    Note: For Redshift, selecting the S3Bucket Objects check box reverse engineers objects from Amazon S3Bucket.

    Table/Views Owned By

    Reverse engineers tables and views by ownership. You must have read and write privileges on all the tables that you want to reverse engineer, regardless of whether you are the owner of the table. Select one of the following ownership options:

    All

    Reverse engineers all tables and views in the database for which you have the necessary permissions, regardless of the owner.

    Current User

    Reverse engineers only those tables and views that are owned by the current user. The current user details are entered in the <Database> Connection dialog.

    Owners (comma separated)

    Reverse engineers the tables and views that are owned by the users that are specified here. Enter the user names in capital letters.
    Note: For Snowflake, the 2020 R2 release does not support Owner and Table Filters in the Reverse Engineering Options set.

    Table Filter

    Specifies the tables that you want to set as filter criteria.

    To set the filter criteria, you must have table owner permissions. For exact matches, mention table names in upper case inside double quotes(for example, "TABLE1"). To use wild cards, mention table names without double quotes (for example, TABLE1).

    To specify multiple tables, use a comma-separated list.

    Click the In button to specify the table spaces to filter the tables from.

    Infer

    Specifies whether you want to infer primary keys or relationships, or both, during reverse engineering. Work with the following options:

    Primary Keys

    Infers primary key columns for the tables that are based on defined indexes.

    Relations

    Infers the relationships between tables that are based on either primary key column names or defined indexes. Select this option and then specify whether to use primary key column names or defined indexes:

    Indexes

    Infers the relationships from the table indexes. Relationships are inferred from table indexes only if the primary key columns of the parent table are part of the index in the child table.

    Names

    Infers the relationships from the primary key column names. Relationships are inferred from columns names only if all of the primary key columns of the parent are in the child table.

    Note: If the target database or script supports primary and foreign key declarations, you do not need to use the Primary Keys, Relations, Indexes, or Names options.

    Case Conversion of Physical Names

    Specifies how the case conversion of physical names is handled during reverse engineering. Work with the following options:

    None

    Preserves the case exactly as it appears in the script file or database.

    lower

    Converts the names to lower case.

    UPPER

    Converts the names to upper case.

    Force

    Overrides the physical name property for all objects in logical/physical models automatically during reverse engineering.

    If this option is not enabled, all logical and physical names are set to the same value after the process completes. If this option is enabled, the logical/physical link is broken between the logical and physical name.

    Case Conversion of Logical Names

    Specifies how the case conversion of logical names is handled during reverse engineering. Work with the following options:

    None

    Preserves the case exactly as it appears in the script file or database.

    lower

    Converts the names to lower case.

    UPPER

    Converts the names to upper case.

    Mixed

    Preserves mixed-case logical names.

    Include Generated Triggers
    Specifies whether erwin-generated triggers are loaded during the reverse engineer process. This option is linked to the Automatically Create RI Triggers setting in the Model Editor, RI Defaults tab. When you choose to create RI triggers automatically, the triggers are treated as model objects. These objects can be forward-engineered into a model, database, or script file. You can include or exclude automatically generated triggers when you reverse engineer.
  10. Click OK.

    The reverse engineering process starts. Once the process is complete, based on your selections, a schema is generated and a model is created.

More information:

Reverse Engineer Processing Errors

How to Reverse Engineer a Model from a Database or a Script